import {I18Parse} from '@lowcode/jpaas-common-lib';
import apiFormCoreLang from '../../../locales/lang/impl/form/apiFormCoreLang';
let lang = apiFormCoreLang;
let i18n=function (langKey,text) {
    return I18Parse.getI18Val(lang.apiFormCore,langKey, text);
}

let scriptLib=[
    {
        name:i18n('pages','页数'),
        clickEvent:"return params.pageNo"
    },
    {
        name:i18n('pageSize','页大小'),
        clickEvent:"return params.pageSize"
    },
    {
        name:i18n('sortField','排序字段'),
        clickEvent:"return params.sortField"
    },
    {
        name:i18n('paramMap','参数上下文(map对象)'),
        clickEvent:"params"
    }
];

let defaultJavaCode= `import com.redxun.core.common.entity.JsonResult;
import java.util.Map;

//${i18n('judgeEachRow','对每一行进行判断处理')}
JsonResult handRow(Map<String,Object> data){
    //return JsonResult.fail("${i18n('errorCause','出错原因')}");
    return JsonResult.success();
}

//${i18n('processData','对读取的数据进行处理')}
JsonResult beforeInsert(List<Map<String,Object>> data){
    //return JsonResult.fail("${i18n('errorCause','出错原因')}");
    return JsonResult.success();
}`

export {
    scriptLib,
    defaultJavaCode
} ;